package marksys.free.com.marksys.utils.android;

import android.content.Context;
import android.net.Uri;
import android.os.Environment;
import android.support.v4.content.FileProvider;
import java.io.File;

public class ExternalFileProvider extends FileProvider {

    public static File getFileForUri(Context context, Uri uri) {
        if (uri.getPath().contains("my_external_path")) {
            String path = uri.getPath();
            path = path.replaceAll("/my_external_path", Environment.getExternalStorageDirectory().getAbsolutePath());
            return new File(path);
        }
        return null;
    }
}